package com.xuxin.nantai.presenter;

import com.xuxin.nantai.bean.AllAreaBean;
import com.xuxin.nantai.bean.BaseBean;
import com.xuxin.nantai.bean.HangUpdateLoginBean;
import com.xuxin.nantai.bean.PackInfoBean;
import com.xuxin.nantai.contract.AllAreaContract;
import com.xuxin.nantai.contract.PackUpdateContract;
import com.xuxin.nantai.model.AllAreaModel;
import com.xuxin.nantai.model.PackUpdateModel;

/**
 * Created by xu_xin
 * Created on 2020.06.22 0022
 */
public class AllAreaPresenter implements AllAreaContract.Presenter {
    private AllAreaModel model;
    private AllAreaContract.View view;

    public AllAreaPresenter(AllAreaContract.View view) {
        model = new AllAreaModel();
        this.view = view;
    }

    @Override
    public void getDefaultArea(String loginName) {
        if (null != model) {
            model.getDefaultArea(this,loginName);
        }
    }

    @Override
    public void getAllArea() {
        if (null != model) {
            model.getAllArea(this);
        }
    }

    @Override
    public void onSuccess(HangUpdateLoginBean hangUpdateLoginBean) {
        if (null != view) {
            view.onSuccess(hangUpdateLoginBean);
        }
    }

    @Override
    public void onSuccess(AllAreaBean allAreaBean) {
        if (null != view) {
            view.onSuccess(allAreaBean);
        }
    }

    /**
     * 以下内容复用
     */
    @Override
    public void onError(BaseBean baseBean) {
        if (null != view) {
            view.onError(baseBean);
        }
    }

    @Override
    public void onComplete() {
        if (null != view) {
            view.onComplete();
        }
    }
}